package net.message;

import net.message.processor.IMessageProcessor;
import net.Client;
import net.Util;

public class JoinImageResponseMessage implements Message{

    public final int imageID;

    public JoinImageResponseMessage(int imageID) {
        this.imageID = imageID;
    }

    public JoinImageResponseMessage(byte[] source) {
        this(Util.byteArrayToInt(source));
    }
    
    public byte[] toByteArray() {
        return Util.intToByteArray(imageID);
    }

    @Override
    public MessageType getType(){
        return MessageType.JOIN_IMAGE_RESPONSE;
    }

    @Override
    public void accept(IMessageProcessor processor, Client client) {
        processor.process(this, client);
    }

}
